﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace ef_core_2025_learn.Entity.Configuration;

public class AddressConfiguration: IEntityTypeConfiguration<Address>
{
    public void Configure(EntityTypeBuilder<Address> builder)
    {
        builder.OwnsOne(address => address.Coordinate, builder =>
        {
            builder.Property(address => address.Latitude).HasPrecision(18, 7);
            builder.Property(address => address.Longitude).HasPrecision(18, 7);
        });
    }
}